package cn.initcap.designpattern.pattern.creational.factorymethod;

/**
 * 工厂方法模式
 *
 * @author initcap
 * @date 2018/8/28 AM9:06
 */
public class Test {

    public static void main(String[] args) {
        // 扩展只需要增加工厂类
        run(new PythonBaseVideoFactory());
        run(new JavaBaseVideoFactory());
        run(new FeBaseVideoFactory());
    }

    /**
     * 业务逻辑不需要变更
     *
     * @param baseVideoFactory
     */
    private static void run(BaseVideoFactory baseVideoFactory) {
        BaseVideo baseVideo = baseVideoFactory.getVideo();
        baseVideo.produce();
    }

}
